package com.xiaoshuidi.cloud.module.finance.enums.invoice;

import lombok.Getter;

/**
 * @author dujianguang
 */
@Getter
public enum BwFpTaxNumEnm {
    TAX_SF(0.03, "1100301010000000000"),
    TAX_FWF(0.06, "3040801010000000000"),
    TAX_ZJ(0.09, "3040502020400000000"),
    TAX_TCF(0.09, "3040502020200000000"),
    TAX_DF(0.13, "1100101020200000000");

    private Double tax;
    private String taxCode;

    BwFpTaxNumEnm(double tax, String taxCode) {
        this.tax = tax;
        this.taxCode = taxCode;
    }


    public static Double getTaxByCode(String code) {
        for (BwFpTaxNumEnm bwFpTaxNumEnm : BwFpTaxNumEnm.values()) {
            if (code.equals(bwFpTaxNumEnm.getTaxCode())) {
                return bwFpTaxNumEnm.tax;
            }
        }
        return null;
    }


}
